<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateRulePolicyTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('rule_policy', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('admin_id')->comment('管理员ID');
            $table->string('policy_id')->comment('政策ID');
            $table->string('policy_code')->comment('政策代码');
            $table->integer('platform')->comment('上传平台：10=携程，20=去哪，30=同程，40=飞猪，50=美团');
            $table->char('airline',8)->comment('航司');
            $table->tinyInteger('way')->comment('行程类型：1=单程，2=往返，3=多程');
            $table->string('flight_date',32)->comment('航班有效期');
            $table->string('sale_date',32)->comment('销售有效期');
            $table->char('cabin',8)->comment('上传舱位');
            $table->tinyInteger('status')->comment('状态：1=有效，2=无效，3=删除');
            $table->decimal('commision',4,2)->comment('代理费率');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('rule_policy');
    }
}
